package com.hs.mod_archive.fragment

import android.os.Bundle
import android.view.View
import androidx.navigation.Navigation.findNavController
import com.hs.framework.base.BaseDataBindFragment
import com.hs.mod_archive.R
import com.hs.mod_archive.databinding.FragmentSysManagerBinding

class FragmentSysManager : BaseDataBindFragment<FragmentSysManagerBinding>() {
    override fun initView(view: View, savedInstanceState: Bundle?) {
        mBinding!!.labelPagerHeader.bannerTvTitle.setText(R.string.sysManager)
        mBinding!!.labelPagerHeader.bannerTvBack.setOnClickListener { navigateUp() }
        mBinding!!.btList.setOnCheckedChangeListener { _, checkedId ->
            if (checkedId == R.id.typeManagement) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentArchiveTypeManagement, Bundle())
            } else if (checkedId == R.id.levelManagement) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentArchiveLevelManagement, Bundle())
            } else if (checkedId == R.id.statusManager) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentArchiveStatusManagement, Bundle())
            } else if (checkedId == R.id.archiveLog) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentArchiveLog, Bundle())
            } else if (checkedId == R.id.archiveChange) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentArchiveChange, Bundle())
            } else if (checkedId == R.id.optLog) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentOptLog, Bundle())
            } else if (checkedId == R.id.userManager) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentUserManager, Bundle())
            } else if (checkedId == R.id.deviceManager) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentDeviceManager, Bundle())
            } else if (checkedId == R.id.alarmManager) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentAlarmManagement, Bundle())
            } else if (checkedId == R.id.earlyWarningManager) {
                findNavController(mBinding!!.navSysSetting)
                    .navigate(R.id.FragmentEarlyWarningManagement, Bundle())
            }
        }
    }
}
